package com.test.daily.leetcode.y2021.m12.day1212;

/**
 * @author Tom on 2021/12/12
 */
public class Code01_ToLowerCase {
    public static void main(String[] args) {
        String s = "Hello";
        Code01_ToLowerCase ct = new Code01_ToLowerCase();
        System.out.println(ct.toLowerCase(s));
    }
    public String toLowerCase(String s) {
        StringBuilder str = new StringBuilder();
        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) >='A' && s.charAt(i)<='Z'){
                str.append((char)(s.charAt(i)+('a' - 'A')));
            }else{
                str.append(s.charAt(i));
            }
        }
        return str.toString();
    }
}
